﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<skags.Models.ArticleCatViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Ný grein
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="navigation">
<% Html.RenderPartial("IndexNavigation"); %>
</div>
<div id="content">
<h2>Senda inn grein</h2>
<p>Senda inn grein til samþykkis stjórnenda</p>
<% Html.RenderPartial("tinyMCE"); %>
    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        <fieldset>
            <legend>Upplýsingar</legend>
            
            <div class="editor-label">
                Titill:
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Title) %>
                <%: Html.ValidationMessageFor(model => model.Title) %>
            </div>
            
            <div class="editor-label">
                Texti:
            </div>
            <div class="editor-field">
                <%: Html.TextAreaFor(model => model.Text, new { cols = 60, rows = 20 })%>
                <%: Html.ValidationMessageFor(model => model.Text) %>
            </div>
            
            <div class="editor-label">
                Flokkur:
            </div>
            <div class="editor-field">
                <select name="CategoryID">
            <%
           
                foreach (var s in Model.Categories)
                {
                    %>
                    <option value="<%= s.ID %>"<%= s.ID == Model.CategoryID ? " selected" : "" %>><%: s.Title %></option>
                        <%
                }
            %>
            </select>
                <%: Html.ValidationMessageFor(model => model.CategoryID) %>
            </div>
        </fieldset>
             <p>
                <input type="submit" value="Vista" />
            </p>
    <% } %>
</asp:Content>